package com.cqd.entity;

import lombok.Data;

import javax.persistence.*;

@Entity
@Data
@Table(name = "t_goods")
public class Goods {
    @Id
    @Column(name = "id")
    private Long id;

    @Column(name = "gname")
    private String gname;

    @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    @JoinColumn(
            name = "bid",
            referencedColumnName = "id",
            insertable = false,
            updatable = false
    )
    private Brand brand;

}
